<?php
class Mdic extends CI_Model{
	function __construct(){
		parent::__construct();
	}
	function getNameBy($classid,$type){
		$sql = "select *
				from tbdic
				where type = ? and classid= ?";
		$query = $this->db->query($sql,array("$type","$classid"));
		foreach ($query->result() as $row){
			return $row->name;
		}
		return "";
	}
}
?>